//
//  FMFindViewController.m
//  PsychologyFM
//
//  Created by zhang on 16/1/11.
//  Copyright © 2016年 ZhangLuDu. All rights reserved.
//

#import "FMFindViewController.h"
#import "PKRequestManager.h"
#import "FMFindWheelModel.h"
#import "FMFindAnchorModel.h"
#import "FMFindMainTableViewCell.h"
#import "SDCycleScrollView.h"
#import "FMFindWheelTakeViewController.h"
#import "FMAnchorCollectionViewCell.h"
#import "FMMoreAnchorViewController.h"
#import "FMAntorMoreTableViewCell.h"
#import "FMAntorDescViewController.h"
#import "FMCellViewController.h"

@interface FMFindViewController ()<UITableViewDelegate,UITableViewDataSource,UISearchBarDelegate,UISearchResultsUpdating,UICollectionViewDataSource,UICollectionViewDelegate,SDCycleScrollViewDelegate>

@property (nonatomic, strong)NSMutableArray *dataArr;    // 轮播图数据
@property (nonatomic, strong)NSMutableArray *dataAnchor; // 主播数据
@property (nonatomic, strong)NSMutableArray *imageArray; // 轮播图url数组
@property (strong, nonatomic)NSMutableArray  *dataList; // 搜索的总数据列表
@property (strong, nonatomic)NSMutableArray  *searchList; // 搜索出的数据列表
@property (nonatomic, strong)UISearchController *seachVC;
@property (nonatomic, strong) UIView *baseView; // tableView表头视图
@property (nonatomic, strong) UIView *tailView; // tableView表尾视图
@property (nonatomic, strong)UITableView *tableView;
@property (nonatomic, strong)UICollectionView *collectionView;
@property (nonatomic, strong)UICollectionViewFlowLayout *layout;
@end

@implementation FMFindViewController

- (void)cycleScrollView:(SDCycleScrollView *)cycleScrollView didSelectItemAtIndex:(NSInteger)index
{
    NSLog(@"1");
    NSArray *values = _dataArr;
    FMFindWheelModel *model = values[index];
    FMCellViewController *cellVC = [[FMCellViewController alloc] init];
    cellVC.myTag = [NSString stringWithFormat:@"http://bapi.xinli001.com/fm2/broadcast_list.json/?rows=15&offset=0&key=c0d28ec0954084b4426223366293d190&tag=%@",model.name];
    cellVC.topTitle = model.title;
    cellVC.rootVC = _rootVC;
    [self.navigationController pushViewController:cellVC animated:YES];

}

- (void)viewDidLoad {
    _dataArr = [NSMutableArray array];
    _dataAnchor = [NSMutableArray array];
    _imageArray = [NSMutableArray array];
    
    self.automaticallyAdjustsScrollViewInsets = NO;

    [super viewDidLoad];
    // Do any additional setup after loading the view.
    [self requestData];
    [self addTableView];
}

- (void)viewDidAppear:(BOOL)animated
{
    self.navigationController.navigationBar.hidden = YES;
    _rootVC.scrollView.scrollEnabled = YES;
    _rootVC.tabbar.hidden = NO;
}

- (void)requestData
{
    [PKRequestManager requestWithUrlString:@"http://bapi.xinli001.com/fm2/hot_tag_list.json/?flag=4&key=c0d28ec0954084b4426223366293d190&rows=3&offset=0" parDic:nil method:GET finish:^(NSData *data) {
        NSDictionary *dic = [NSJSONSerialization JSONObjectWithData:data options:NSJSONReadingMutableContainers error:nil];
        NSArray *array = dic[@"data"];
        for (NSDictionary *dicc in array) {
            FMFindWheelModel *model = [[FMFindWheelModel alloc] init];
            [model setValuesForKeysWithDictionary:dicc];
            [_dataArr addObject:model];
            [_imageArray addObject:model.cover];
        }
        
        SDCycleScrollView *topscrollView = [SDCycleScrollView cycleScrollViewWithFrame:CGRectMake(0, 0, kScreenWidth, 220) imageURLStringsGroup:self.imageArray];
        topscrollView.delegate = self;
        topscrollView.pageControlAliment = SDCycleScrollViewPageContolAlimentCenter;
        [self.baseView addSubview:topscrollView];
    } error:^(NSError *error) {
    }];
    
    [PKRequestManager requestWithUrlString:@"http://yiapi.xinli001.com/fm/diantai-find-list.json?key=c0d28ec0954084b4426223366293d190&rows=6&offset=0" parDic:nil method:GET finish:^(NSData *data) {
        NSDictionary *dic = [NSJSONSerialization JSONObjectWithData:data options:NSJSONReadingMutableContainers error:nil];
        NSArray *array = dic[@"data"];
        for (NSDictionary *dicc in array) {
            FMFindAnchorModel *model = [[FMFindAnchorModel alloc] init];
            [model setValuesForKeysWithDictionary:dicc];
            [_dataAnchor addObject:model];
        }
        [_collectionView reloadData];
    } error:^(NSError *error) {
    }];
}


- (void)addTableView
{
    _tableView = [[UITableView alloc] initWithFrame:CGRectMake(0, 0, kScreenWidth, kScreenHeight - 49)];
    _tableView.delegate = self;
    _tableView.dataSource = self;
    _tableView.rowHeight = kScreenWidth;
    [self.view addSubview:_tableView];
    
    _baseView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, kScreenWidth, 300)];
    _tableView.tableHeaderView = _baseView;
    _tailView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, kScreenWidth, 290)];
    _tableView.tableFooterView = _tailView;
    
    _seachVC = [[UISearchController alloc] initWithSearchResultsController:nil];
    _seachVC.view.backgroundColor = [UIColor whiteColor];
    _seachVC.searchResultsUpdater = self;
    //    _seachVC.dimsBackgroundDuringPresentation = YES;
    _seachVC.hidesNavigationBarDuringPresentation = NO;
    [_seachVC.searchBar setBackgroundImage:[UIImage new]];
    _seachVC.searchBar.placeholder = @"搜索主播名/节目名";
    [_seachVC.searchBar sizeToFit];
    _seachVC.searchBar.frame = CGRectMake(0, 240, kScreenWidth, 50);
    [_baseView addSubview:_seachVC.searchBar];
    
    _layout = [[UICollectionViewFlowLayout alloc] init];
    _layout.minimumLineSpacing = 5;
    _layout.minimumInteritemSpacing = 40 ;
    _layout.itemSize = CGSizeMake(140, 70);
    _collectionView = [[UICollectionView alloc] initWithFrame:CGRectMake(0, 50, kScreenWidth, 230) collectionViewLayout:_layout];
    _collectionView.delegate = self;
    _collectionView.dataSource = self;
    _collectionView.backgroundColor = [UIColor whiteColor];
    [_tailView addSubview:_collectionView];
    
    
    UIButton *pickButton = [UIButton buttonWithType:(UIButtonTypeCustom)];
    pickButton.frame = CGRectMake(kScreenWidth - 60, 5, 60, 30);
    [pickButton setTitleColor:[UIColor blackColor] forState:(UIControlStateNormal)];
    [pickButton setTitle:@" > " forState:(UIControlStateNormal)];
    [pickButton addTarget:self action:@selector(click:) forControlEvents:(UIControlEventTouchUpInside)];
    [_tailView addSubview:pickButton];
    
    UILabel *pickLabel = [[UILabel alloc] initWithFrame:CGRectMake(20, 5, kScreenWidth / 6, 30)];
    pickLabel.text = @"播放";
    [_tailView addSubview:pickLabel];
    
    // 注册collection 的 cell
    [_collectionView registerClass:[FMAnchorCollectionViewCell class] forCellWithReuseIdentifier:@"FMAnchorCollectionViewCell"];
    [_collectionView reloadData];


    [_tableView registerClass:[FMFindMainTableViewCell class] forCellReuseIdentifier:@"FMFindMainTableViewCell"];
    [_tableView registerClass:[FMAntorMoreTableViewCell class] forCellReuseIdentifier:@"FMAntorMoreTableViewCell"];
    [_collectionView reloadData];
}


#pragma --- 其他点击方法
- (void)click:(UIButton *)button
{
    FMMoreAnchorViewController *moreAnchorVC = [[FMMoreAnchorViewController alloc] init];
    moreAnchorVC.rootVC = _rootVC;
    [self.navigationController pushViewController:moreAnchorVC animated:YES];
}

#pragma --- tableView代理方法
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
    return 1;
}

- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
{
    return 2;
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    if (indexPath.section == 0) {
        
        FMFindMainTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"FMFindMainTableViewCell"];
        [cell.dysphoriaButton setImage:[UIImage imageNamed:@"emotion1"] forState:(UIControlStateNormal)];
        [cell.dysphoriaButton addTarget:self action:@selector(dysphoriaButton:) forControlEvents:(UIControlEventTouchUpInside)];
        [cell.sadButton setImage:[UIImage imageNamed:@"emotion2"] forState:(UIControlStateNormal)];
        [cell.sadButton addTarget:self action:@selector(sadButton:) forControlEvents:(UIControlEventTouchUpInside)];
        [cell.aloneButton setImage:[UIImage imageNamed:@"emotion3"] forState:(UIControlStateNormal)];
        [cell.aloneButton addTarget:self action:@selector(aloneButton:) forControlEvents:(UIControlEventTouchUpInside)];
        [cell.getUpButton setImage:[UIImage imageNamed:@"emotion4"] forState:(UIControlStateNormal)];
        [cell.getUpButton addTarget:self action:@selector(getUpButton:) forControlEvents:(UIControlEventTouchUpInside)];

        [cell.decompressionButton setImage:[UIImage imageNamed:@"emotion5"] forState:(UIControlStateNormal)];
        [cell.decompressionButton addTarget:self action:@selector(decompressionButton:) forControlEvents:(UIControlEventTouchUpInside)];
        [cell.helplessButton setImage:[UIImage imageNamed:@"emotion6"] forState:(UIControlStateNormal)];
        [cell.helplessButton addTarget:self action:@selector(helplessButton:) forControlEvents:(UIControlEventTouchUpInside)];
        [cell.funButton setImage:[UIImage imageNamed:@"emotion7"] forState:(UIControlStateNormal)];
        [cell.funButton addTarget:self action:@selector(funButton:) forControlEvents:(UIControlEventTouchUpInside)];
        [cell.touchButton setImage:[UIImage imageNamed:@"emotion8"] forState:(UIControlStateNormal)];
        [cell.touchButton addTarget:self action:@selector(touchButton:) forControlEvents:(UIControlEventTouchUpInside)];
        [cell.unseeingButton setImage:[UIImage imageNamed:@"emotion9"] forState:(UIControlStateNormal)];
        [cell.unseeingButton addTarget:self action:@selector(unseeingButton:) forControlEvents:(UIControlEventTouchUpInside)];
        cell.dysphoriaLabel.text = @"烦躁";
        cell.sadLabel.text = @"悲伤";
        cell.aloneLabel.text = @"孤独";
        cell.getUpLabel.text = @"已弃疗";
        cell.decompressionLabel.text = @"减压";
        cell.helpLessLabel.text = @"无奈";
        cell.funLabel.text = @"快乐";
        cell.touchLabel.text = @"感动";
        cell.unseeingLabel.text = @"迷茫";

        return cell;
    }
    else
    {
        FMAntorMoreTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"FMAntorMoreTableViewCell"];
        [cell.sleepButton setImage:[UIImage imageNamed:@"scene1"] forState:(UIControlStateNormal)];
        [cell.sleepButton addTarget:self action:@selector(sleepButton:) forControlEvents:(UIControlEventTouchUpInside)];
        [cell.travelButton setImage:[UIImage imageNamed:@"scene2"] forState:(UIControlStateNormal)];
        [cell.travelButton addTarget:self action:@selector(travelButton:) forControlEvents:(UIControlEventTouchUpInside)];
        [cell.takeButton setImage:[UIImage imageNamed:@"scene3"] forState:(UIControlStateNormal)];
        [cell.takeButton addTarget:self action:@selector(takeButton:) forControlEvents:(UIControlEventTouchUpInside)];
        [cell.carButton setImage:[UIImage imageNamed:@"scene4"] forState:(UIControlStateNormal)];
        [cell.carButton addTarget:self action:@selector(carButton:) forControlEvents:(UIControlEventTouchUpInside)];
        [cell.myButton setImage:[UIImage imageNamed:@"scene5"] forState:(UIControlStateNormal)];
        [cell.myButton addTarget:self action:@selector(myButton:) forControlEvents:(UIControlEventTouchUpInside)];
        [cell.lovelornButton setImage:[UIImage imageNamed:@"scene6"] forState:(UIControlStateNormal)];
        [cell.lovelornButton addTarget:self action:@selector(lovelornButton:) forControlEvents:(UIControlEventTouchUpInside)];
        [cell.noSleepButton setImage:[UIImage imageNamed:@"scene7"] forState:(UIControlStateNormal)];
        [cell.noSleepButton addTarget:self action:@selector(noSleepButton:) forControlEvents:(UIControlEventTouchUpInside)];
        [cell.atwellButton setImage:[UIImage imageNamed:@"scene8"] forState:(UIControlStateNormal)];
        [cell.atwellButton addTarget:self action:@selector(atwellButton:) forControlEvents:(UIControlEventTouchUpInside)];
        [cell.boringButton setImage:[UIImage imageNamed:@"scene9"] forState:(UIControlStateNormal)];
        [cell.boringButton addTarget:self action:@selector(boringButton:) forControlEvents:(UIControlEventTouchUpInside)];
        cell.sleepLabel.text = @"睡前";
        cell.travelLabel.text = @"旅行";
        cell.takeLabel.text = @"散步";
        cell.carLabel.text = @"坐车";
        cell.myLabel.text = @"独处";
        cell.lovelornLabel.text = @"失恋";
        cell.noSleepLabel.text = @"失眠";
        cell.atwellLabel.text = @"随便";
        cell.boringLabel.text = @"无聊";
        return cell;
    }
}

- (NSString *)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section
{
    if (section == 0) {
        return @"心情";
    }
    else
        return @"场景";
}

#pragma --- seachbar 搜索
-(void)updateSearchResultsForSearchController:(UISearchController *)searchController {
    NSString *searchString = [self.seachVC.searchBar text];
    NSPredicate *preicate = [NSPredicate predicateWithFormat:@"SELF CONTAINS[c] %@", searchString];
    if (self.searchList!= nil) {
        [self.searchList removeAllObjects];
    }
    //过滤数据
    self.searchList= [NSMutableArray arrayWithArray:[_dataList filteredArrayUsingPredicate:preicate]];
    //刷新表格
    [self.tableView reloadData];
    NSLog(@"%@",searchController);
}

#pragma --- seachbar的开始搜索和结束搜索的方法
- (BOOL)searchBarShouldBeginEditing:(UISearchBar *)searchBar{
    NSLog(@"搜索Begin");
    return YES;
}
- (BOOL)searchBarShouldEndEditing:(UISearchBar *)searchBar{
    NSLog(@"搜索End");
    return YES;
}

#pragma collectionView的代理方法
- (NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section
{
    return _dataAnchor.count - 4;
}

- (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath
{
    FMAnchorCollectionViewCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:@"FMAnchorCollectionViewCell" forIndexPath:indexPath];
    FMFindAnchorModel *model = _dataAnchor[indexPath.row];
    cell.model = model;
    return cell;
}

- (void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath
{
    FMFindAnchorModel *model = _dataAnchor[indexPath.row];
    FMAntorDescViewController *AntorDescVC = [[FMAntorDescViewController alloc] init];
    AntorDescVC.idStr = model.ID;
    AntorDescVC.rootVC = _rootVC;
    [self.navigationController pushViewController:AntorDescVC animated:YES];
}

#pragma --- cell的button的点击方法 --- 心情
- (void)dysphoriaButton:(UIButton *)button
{
    FMCellViewController *cellVC = [[FMCellViewController alloc] init];
    NSString *str = @"http://bapi.xinli001.com/fm2/broadcast_list.json/?rows=15&offset=0&key=c0d28ec0954084b4426223366293d190&tag=烦躁";
    cellVC.topTitle = @"烦躁";
    cellVC.rootVC = _rootVC;
    cellVC.myTag = str;
    [self.navigationController pushViewController:cellVC animated:YES];
    
}

- (void)sadButton:(UIButton *)button
{
    FMCellViewController *cellVC = [[FMCellViewController alloc] init];
    NSString *str = @"http://bapi.xinli001.com/fm2/broadcast_list.json/?rows=15&offset=0&key=c0d28ec0954084b4426223366293d190&tag=悲伤";
    cellVC.myTag = str;
    cellVC.topTitle = @"悲伤";
    cellVC.rootVC = _rootVC;

    [self.navigationController pushViewController:cellVC animated:YES];
    
}

- (void)aloneButton:(UIButton *)button
{
    FMCellViewController *cellVC = [[FMCellViewController alloc] init];
    NSString *str = @"http://bapi.xinli001.com/fm2/broadcast_list.json/?rows=15&offset=0&key=c0d28ec0954084b4426223366293d190&tag=孤独";
    cellVC.myTag = str;
    cellVC.rootVC = _rootVC;
    cellVC.topTitle = @"孤独";

    [self.navigationController pushViewController:cellVC animated:YES];
    
}

- (void)getUpButton:(UIButton *)button
{
    FMCellViewController *cellVC = [[FMCellViewController alloc] init];
    NSString *str = @"http://bapi.xinli001.com/fm2/broadcast_list.json/?rows=15&offset=0&key=c0d28ec0954084b4426223366293d190&tag=已弃疗";
    cellVC.myTag = str;
    cellVC.rootVC = _rootVC;

    cellVC.topTitle = @"已弃疗";

    [self.navigationController pushViewController:cellVC animated:YES];
    
}

- (void)decompressionButton:(UIButton *)button
{
    FMCellViewController *cellVC = [[FMCellViewController alloc] init];
    NSString *str = @"http://bapi.xinli001.com/fm2/broadcast_list.json/?rows=15&offset=0&key=c0d28ec0954084b4426223366293d190&tag=减压";
    cellVC.myTag = str;
    cellVC.rootVC = _rootVC;

    cellVC.topTitle = @"减压";

    [self.navigationController pushViewController:cellVC animated:YES];
    
}

- (void)helplessButton:(UIButton *)button
{
    FMCellViewController *cellVC = [[FMCellViewController alloc] init];
    NSString *str = @"http://bapi.xinli001.com/fm2/broadcast_list.json/?rows=15&offset=0&key=c0d28ec0954084b4426223366293d190&tag=无奈";
    cellVC.myTag = str;
    cellVC.topTitle = @"无奈";
    cellVC.rootVC = _rootVC;
    [self.navigationController pushViewController:cellVC animated:YES];
    
}

- (void)funButton:(UIButton *)button
{
    FMCellViewController *cellVC = [[FMCellViewController alloc] init];
    NSString *str = @"http://bapi.xinli001.com/fm2/broadcast_list.json/?rows=15&offset=0&key=c0d28ec0954084b4426223366293d190&tag=快乐";
    cellVC.myTag = str;
    cellVC.topTitle = @"快乐";
    cellVC.rootVC = _rootVC;
    [self.navigationController pushViewController:cellVC animated:YES];
    
}

- (void)touchButton:(UIButton *)button
{
    FMCellViewController *cellVC = [[FMCellViewController alloc] init];
    NSString *str = @"http://bapi.xinli001.com/fm2/broadcast_list.json/?rows=15&offset=0&key=c0d28ec0954084b4426223366293d190&tag=感动";
    cellVC.myTag = str;
    cellVC.topTitle = @"感动";
    cellVC.rootVC = _rootVC;
    [self.navigationController pushViewController:cellVC animated:YES];
    
}

- (void)unseeingButton:(UIButton *)button
{
    FMCellViewController *cellVC = [[FMCellViewController alloc] init];
    NSString *str = @"http://bapi.xinli001.com/fm2/broadcast_list.json/?rows=15&offset=0&key=c0d28ec0954084b4426223366293d190&tag=迷茫";
    cellVC.myTag = str;
    cellVC.topTitle = @"迷茫";
    cellVC.rootVC = _rootVC;
    [self.navigationController pushViewController:cellVC animated:YES];
    
}

#pragma --- 场景Button点击
- (void)sleepButton:(UIButton *)button
{
    FMCellViewController *cellVC = [[FMCellViewController alloc] init];
    NSString *str = @"http://bapi.xinli001.com/fm2/broadcast_list.json/?rows=15&offset=0&key=c0d28ec0954084b4426223366293d190&tag=睡前";
    cellVC.myTag = str;
    cellVC.topTitle = @"睡前";
    cellVC.rootVC = _rootVC;
    [self.navigationController pushViewController:cellVC animated:YES];
    
}

- (void)travelButton:(UIButton *)button
{
    FMCellViewController *cellVC = [[FMCellViewController alloc] init];
    NSString *str = @"http://bapi.xinli001.com/fm2/broadcast_list.json/?rows=15&offset=0&key=c0d28ec0954084b4426223366293d190&tag=旅行";
    cellVC.myTag = str;
    cellVC.topTitle = @"旅行";
    cellVC.rootVC = _rootVC;
    [self.navigationController pushViewController:cellVC animated:YES];
    
}

- (void)takeButton:(UIButton *)button
{
    FMCellViewController *cellVC = [[FMCellViewController alloc] init];
    NSString *str = @"http://bapi.xinli001.com/fm2/broadcast_list.json/?rows=15&offset=0&key=c0d28ec0954084b4426223366293d190&tag=散步";
    cellVC.myTag = str;
    cellVC.topTitle = @"散步";
    cellVC.rootVC = _rootVC;
    [self.navigationController pushViewController:cellVC animated:YES];
    
}

- (void)carButton:(UIButton *)button
{
    FMCellViewController *cellVC = [[FMCellViewController alloc] init];
    NSString *str = @"http://bapi.xinli001.com/fm2/broadcast_list.json/?rows=15&offset=0&key=c0d28ec0954084b4426223366293d190&tag=坐车";
    cellVC.myTag = str;
    cellVC.topTitle = @"坐车";
    cellVC.rootVC = _rootVC;
    [self.navigationController pushViewController:cellVC animated:YES];
    
}

- (void)myButton:(UIButton *)button
{
    FMCellViewController *cellVC = [[FMCellViewController alloc] init];
    NSString *str = @"http://bapi.xinli001.com/fm2/broadcast_list.json/?rows=15&offset=0&key=c0d28ec0954084b4426223366293d190&tag=独处";
    cellVC.myTag = str;
    cellVC.topTitle = @"独处";
    cellVC.rootVC = _rootVC;
    [self.navigationController pushViewController:cellVC animated:YES];
    
}

- (void)lovelornButton:(UIButton *)button
{
    FMCellViewController *cellVC = [[FMCellViewController alloc] init];
    NSString *str = @"http://bapi.xinli001.com/fm2/broadcast_list.json/?rows=15&offset=0&key=c0d28ec0954084b4426223366293d190&tag=失恋";
    cellVC.myTag = str;
    cellVC.topTitle = @"失恋";
    cellVC.rootVC = _rootVC;
    [self.navigationController pushViewController:cellVC animated:YES];
    
}

- (void)noSleepButton:(UIButton *)button
{
    FMCellViewController *cellVC = [[FMCellViewController alloc] init];
    NSString *str = @"http://bapi.xinli001.com/fm2/broadcast_list.json/?rows=15&offset=0&key=c0d28ec0954084b4426223366293d190&tag=失眠";
    cellVC.myTag = str;
    cellVC.topTitle = @"失眠";
    cellVC.rootVC = _rootVC;
    [self.navigationController pushViewController:cellVC animated:YES];
    
}

- (void)atwellButton:(UIButton *)button
{
    FMCellViewController *cellVC = [[FMCellViewController alloc] init];
    NSString *str = @"http://bapi.xinli001.com/fm2/broadcast_list.json/?rows=15&offset=0&key=c0d28ec0954084b4426223366293d190&tag=随便";
    cellVC.myTag = str;
    cellVC.topTitle = @"随便";
    cellVC.rootVC = _rootVC;
    [self.navigationController pushViewController:cellVC animated:YES];
    
}

- (void)boringButton:(UIButton *)button
{
    FMCellViewController *cellVC = [[FMCellViewController alloc] init];
    NSString *str = @"http://bapi.xinli001.com/fm2/broadcast_list.json/?rows=15&offset=0&key=c0d28ec0954084b4426223366293d190&tag=无聊";
    cellVC.myTag = str;
    cellVC.topTitle = @"无聊";
    cellVC.rootVC = _rootVC;
    [self.navigationController pushViewController:cellVC animated:YES];
    
}
@end
